home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.3
/
Video Toaster v4.3.iso
/
4.2
/
arexx
/
toasterpaint
/
bwbordervign.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1998-04-16
|
5KB
|
172 lines
/* BWBorderVign.rexx V2.0 -- Colorize a clip. */
/* By Bob Caron © 1995 NewTek Inc. */
parse arg InClipName","OutClipName","StartField","EndField
Address "DigiPaint"
options results
IFFBaseName=OutClipName
if ~show('l','rexxsupport.library') then do
if ~addlib('rexxsupport.library',0,-30,34) then do
exit
end
end
screen=0
if inclipname="" then screen=1
if screen=1 then do
startfield=1
endfield=1
end
/* Reset Paint */
'Pmcl'
'Pot0' 0
'Pot1' 0
'Poth' $8000
'Potv' $8000
'Spoh' $8000
'Spov'
/* End Of Reset*/
PageWide=752
PageHigh=480
x1=94
y1=65
x2=662
y2=428
dots=0
XWin = 100
YWin = 40
Clear = d2c(12)
nv = ''
cr = '0a'x
call getfontsize
wid = width*48
hei = theight+height*10
if screen=0 then do
if ~open('Window','RAW:'XWin'/'YWin'/'wid'/'hei'/BWBorderVign Script V2.0 - CTRL-C to Abort/NOSIZE/SCREEN 'ps,'W') then do
exit
end
end
do Frame = StartField to (StartField+(EndField-StartField)/2)
if screen=0 then call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
if screen=0 then 'Gnfd' /* Get the next field to process */
call filter(x1,y1,x2,y2) /* If this is a flyer clip do other field */
if screen=0 then 'Apfc' /* Apeend the field to clip */
if screen=0 then 'Gnfd' /* Get the next field to process */
if screen=0 then call filter(x1,y1,x2,y2) /* If this is a flyer clip do other field */
if screen=0 then 'Apfc' /* Apeend the field to clip */
if screen=1 then 'Shco' /* Render To Buffer (if this is screen processing)*/
end
if screen=0 then 'Iclp' /* Add an flyer icon to this clip */
exit
filter: PROCEDURE /* Do a filter */
parse arg x1,y1,x2,y2
'Pmcl' /* Set to normal paint mode */
Call CutBrush(0,0,752,480) /* Cut brush along top */
if screen=0 then call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
'Swap'
call MapBrush(x1, y1, x2, y2)
'Swap'
call CutBrush(x1, y1, x2, y2)
if screen=0 then call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
call clearscreen
call MapBrush(0,0,752,480)
'8rgb' 255 255 255 /* White */
'Pmco' /* colorize Mode */
'Mane' /* Set Edge transparency to 0% */
'Whsc' /* Fill Whole Screen */
if screen=0 then call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
'Rubt'
'Drrf'
'Pend' x1 y1
'Penu' x2 y2
'Pmcl'
return
CutBrush: PROCEDURE /* Cut out a brush with corners at (x1,y1) and (x2,y2) */
arg x1, y1, x2, y2
'Pmcl'
'Bdel'
'Dotb' /* smallest brush size */
'Drre' /* Rectangle mode */
'Scis' /* Scissors on, for cutting a brush */
'Pend' x1 y1 /* Get in top Left corner */
'Penu' x2 y2 /* lift pen to get brush! */
return 0
MapBrush: PROCEDURE /* Size swap brush into rectangle with corners at (x1,y1) and (x2,y2) */
arg x1, y1, x2, y2 /* if there is no swap brush, whole screen is used! */
'Bcop'
'Flon' /* Fill On */
'Maxc' /* Set center transparency off */
'Maxe' /* Set edge transparency off */
'Aaon' /* Anti-alias on */
'Txma' /* Texture mapping on, fill on, draw rectangles */
'Drre' /* Draw Rectangles */
'Pend' x1 y1 /* Get in top Left corner */
'Penu' x2 y2 /* lift pen */
'Flof' /* fill off */
'Pmcl' /* Normal draw Mode */
return 0
clearscreen:
'8rgb' 0 0 0
'Clrs'
'Cbx1'
return
OpenWindow:
parse arg InclipName,OutClipName,currentframe,EndFrame,Frame
pdots="...."
dots=dots+1
if dots>4 then dots=1
call writech('Window',Clear||nv||cr)
call writech('Window','Current Source Clip ['InClipName']'cr)
call writech('Window',' Current Dest Clip ['OutClipName']'cr)
call writech('Window',''cr)
call writech('Window','Current Frame: 'Frame/2''cr)
call writech('Window',' End Frame:'EndFrame/2''cr)
call writech('Window',''cr)
call writech('Window','Processing'right(pdots,dots)||cr)
return
getfontsize:
if open('font','env:sys/font.prefs','R') then do
font = readch('font',word(statef('env:sys/font.prefs'),2))
call close('font')
font = substr(font,index(font,'FONT')+4)
font = substr(font,index(font,'FONT')+4)
height = c2d(substr(font,29,2))
tfont = substr(font,index(font,'FONT')+4)
theight = c2d(substr(tfont,29,2))
font = substr(font,33)
font = left(font,index(font,d2c(0))-1-5)
if open('font','FONTS:'font'/'height,'R') then do
pad=readch('font',116)
width = c2d(right(pad,2))
call close('font')
end
else if height=9 then width = 10
else width = 8
end
else do
theight = 8
height = 8
width = 8
end
return